package com.test;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.dubbo.demo.Person;
import com.alibaba.dubbo.demo.Teacher;

import feign.Feign;
import feign.jackson.JacksonDecoder;
import feign.jackson.JacksonEncoder2;
import feign.okhttp.OkHttpClient;

public class PostDemo3 {

	public static void main(String[] args) {
		FeignService feignService = Feign.builder()
				.client(new OkHttpClient())
				.encoder(new JacksonEncoder2())
				.decoder(new JacksonDecoder())
				.target(FeignService.class, "http://localhost:8085");
		// 接口在spring-webflux的com.demo.webflux.feigncore里
		List<Teacher> students = new ArrayList<>();
		students.add(new Teacher("zsl", "27"));
		List<Person> contributors = feignService.contributors4("111", students);
		for (Person contributor : contributors) {
			System.out.println(contributor.getName());
		}
	}

}
